<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <main id="app">
        <form action="">
            姓名：<input type="text" v-model="formData.name"><span>{{formData.name}}</span><br/>
            年龄：<input type="number" v-model="formData.age"><span>{{formData.age}}</span><br/>
            专业：
            <select v-model="formData.major">
                <option value=""></option>
                <option value="1">JAVA</option>
                <option value="2">WEB</option>
                <option value="3">UI</option>
            </select>
            <span>{{formData.major}}</span><br/>
            性别：
            男<input type="radio" v-model="formData.sex" value="1">
            女<input type="radio" v-model="formData.sex" value="2">
            <span>{{formData.sex}}</span><br/>
            取向：
            男<input type="checkbox" v-model="formData.need" value="1">
            女<input type="checkbox" v-model="formData.need" value="2">
            <span>{{formData.need}}</span><br/>
            备注：<input type="text" :value="formData.remark" @input="formData.remark = $event.target.value">
            <span>{{formData.remark}}</span><br/>
        </form>
    </main>
</body>
<script src="../vue.min.js"></script>
<script>
    new Vue({
        el: "#app",
        data() {
            return {
                formData: {
                    name: "Hydra",
                    major: 1,
                    sex: 1,
                    need: [1,2],
                    remark: "超级赛亚人"
                }
            }
        },
        methods: {
            // handleInput(e) {
            //     this.formData.remark = e.target.value;
            // }
        }
    })
</script>
</html>